//
//  GYTimeView.m
//  GoodLuck
//
//  Created by apple on 2018/5/14.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "GYTimeView.h"

@interface GYTimeView ()

@property (weak, nonatomic) IBOutlet UILabel *monthLable;
@property (weak, nonatomic) IBOutlet UILabel *yearLable;
@property (weak, nonatomic) IBOutlet UILabel *dayLable;


@end
@implementation GYTimeView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    NSArray *months = @[@"January",@"February",@"March",@"April",@"May",@"June",
        @"July",@"August",@"September",@"October",@"November",@"December"];
    //获取年月日
    NSDate *date = [NSDate date];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy"];
    self.yearLable.text = [formatter stringFromDate:date];
    
    [formatter setDateFormat:@"M"];
    int month = [[formatter stringFromDate:date] intValue];
    self.monthLable.text = months[month-1];

    
    [formatter setDateFormat:@"d"];
    self.dayLable.text = [formatter stringFromDate:date];
}
@end
